package org.example.xml;

/**
 * @author scout.du
 * @date 2025/10/17 14:48
 **/
public class XML2 {

    public static void main(String[] args) {
        String rawXml = """
                        <value>http://example.com?a=1&b=2&amp;c=3&supportedRadioTechnologies=BT,NFC#23456789</value>
                        """;

        String safeXml = rawXml.replaceAll("&(?![a-zA-Z#]{1,10};)", "&amp;");
        System.out.println(safeXml);

    }
}
